// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.*;
import android.widget.*;
import com.nnee.p_fk.cls_ActivityEx;
import com.nnee.p_img.cls_c;
import com.nnee.p_l.p_b.cls_d;
//import com.nnee.p_i.cls_c;
import com.nnee.p_pr.cls_b;
import com.nnee.p_pr.p_b.cls_a;
import com.nnee.p_pr.cls_v;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            r, t, g, h, 
//            i, k, MainGridActivity, PRISAboutActivity

public class cls_LoginActivity extends cls_ActivityEx
{

    public cls_LoginActivity()
    {
        q = false;
        r = 0;
        s = 0;
        t = 0;
        u = 0;
        v = null;
        w = null;
        x = null;
        y = null;
        B = null;
        j = new cls_r(this);
        k = new cls_t(this);
        l = new cls_g(this);
        m = new cls_h(this);
        n = new cls_i(this);
        o = new cls_k(this);
    }

    static ImageView a(cls_LoginActivity loginactivity)
    {
        return loginactivity.C;
    }

    private void a(int i1)
    {
        t = i1;
        if(t != 0) {
        	if(1 == t)
            {
                l();
                A.setVisibility(8);
            }
        } {
        	 k();
             A.setVisibility(0);
        }
    }

    public static void a(Context context, int i1, int j1)
    {
        Intent intent = new Intent(context, com.nnee.p_pr.p_activity.cls_LoginActivity.class);
        intent.putExtra("state", i1);
        intent.putExtra("from", j1);
        context.startActivity(intent);
    }

    static void a(cls_LoginActivity loginactivity, int i1)
    {
        loginactivity.a(i1);
    }

    static boolean a(cls_LoginActivity loginactivity, String s1)
    {
        return loginactivity.a(s1);
    }

    private boolean a(String s1)
    {
        boolean flag;
        flag = false;
        
        if(!TextUtils.isEmpty(s1) && (com.nnee.p_pr.p_a.cls_e.d(s1) || com.nnee.p_pr.p_a.cls_e.e(s1)))
            flag = true;
        return flag;
    }

    static EditText b(cls_LoginActivity loginactivity)
    {
        return loginactivity.w;
    }

    private void b()
    {
        a(new android.widget.LinearLayout.LayoutParams(-2, com.nnee.p_img.cls_c.a(v, 48F)));
        a(((android.graphics.drawable.Drawable) (null)));
        d(0x7f0200b8);
    }

    private void b(int i1)
    {
        com.nnee.p_l.p_b.cls_d.b(v, 256);
        if(z == 0)
            com.nnee.p_pr.p_activity.cls_MainGridActivity.a(this, 1, true, 0);
        finish();
    }

    static void b(cls_LoginActivity loginactivity, int i1)
    {
        loginactivity.b(i1);
    }

    static boolean b(cls_LoginActivity loginactivity, String s1)
    {
        return loginactivity.c(s1);
    }

    static EditText c(cls_LoginActivity loginactivity)
    {
        return loginactivity.x;
    }

    private void c()
    {
        w = (EditText)findViewById(0x7f0d009c);
        x = (EditText)findViewById(0x7f0d009e);
        y = (Button)findViewById(0x7f0d00a3);
        A = (LinearLayout)findViewById(0x7f0d009a);
        C = (ImageView)findViewById(0x7f0d009d);
        D = (ImageView)findViewById(0x7f0d009f);
        B = (TextView)findViewById(0x7f0d00a2);
        E = (TextView)findViewById(0x7f0d00a0);
        F = (TextView)findViewById(0x7f0d00a1);
    }

    private boolean c(String s1)
    {
        boolean flag;
        if(TextUtils.isEmpty(s1))
            flag = false;
        else
            flag = true;
        return flag;
    }

    static Button d(cls_LoginActivity loginactivity)
    {
        return loginactivity.y;
    }

    static ImageView e(cls_LoginActivity loginactivity)
    {
        return loginactivity.D;
    }

    private void e()
    {
        if(w != null)
        {
            w.addTextChangedListener(j);
            w.setOnFocusChangeListener(l);
        }
        if(x != null)
        {
            x.addTextChangedListener(k);
            x.setOnFocusChangeListener(m);
        }
        if(y != null)
            y.setOnClickListener(n);
        if(C != null)
            C.setOnClickListener(n);
        if(D != null)
            D.setOnClickListener(n);
        if(E != null)
            E.setOnClickListener(n);
        if(F != null)
            F.setOnClickListener(n);
    }

    static Context f(cls_LoginActivity loginactivity)
    {
        return loginactivity.v;
    }

    private void f()
    {
        if(w.length() <= 0 || x.length() <= 0)
        {
            Toast.makeText(this, "Input Name or Password", 1).show();
        } else
        {
            String s1 = w.getEditableText().toString();
            String s2 = x.getEditableText().toString();
            r = com.nnee.p_pr.cls_v.a().a(s1, s2, z);
        }
    }

    private void g()
    {
        com.nnee.p_pr.p_activity.cls_PRISAboutActivity.a((Context)this);
    }

    static void g(cls_LoginActivity loginactivity)
    {
        loginactivity.f();
    }

    static int h(cls_LoginActivity loginactivity)
    {
        return loginactivity.r;
    }

    static int i(cls_LoginActivity loginactivity)
    {
        return loginactivity.u;
    }

    static int j(cls_LoginActivity loginactivity)
    {
        int i1 = loginactivity.u;
        loginactivity.u = i1 + 1;
        return i1;
    }

    public void a(View view)
    {
        if(w != null)
            w.setText("");
    }

    public void b(View view)
    {
        if(x != null)
            x.setText("");
    }

    public void c(View view)
    {
        if((view instanceof TextView) && A != null)
            startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://reg.163.com/getpasswd/RetakePassword.jsp")));
    }

    public void d(View view)
    {
        if((view instanceof TextView) && A != null)
            startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://reg.163.com/reg/reg.jsp?product=urs")));
    }

    public void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        setContentView(0x7f030030);
        u = 0;
        v = this;
        Intent intent = getIntent();
        if(intent != null)
        {
            s = intent.getIntExtra("state", 0);
            z = intent.getIntExtra("from", 0);
        }
        com.nnee.p_pr.cls_v.a().a(o);
        c();
        e();
        q = true;
        if(com.nnee.p_pr.p_b.cls_a.c() != null && com.nnee.p_pr.p_b.cls_a.g() != null)
            q = false;
        if(q && y != null)
        {
            y.setClickable(false);
            y.setEnabled(false);
        }
        if(s == 0)
        {
            if(w != null)
                w.setText(com.nnee.p_pr.p_b.cls_a.c());
            if(x != null)
                x.setText(com.nnee.p_pr.p_b.cls_a.g());
        } else
        if(1 == s)
        {
            if(w != null)
                w.setText("");
            if(x != null)
                x.setText("");
        }
        b();
        a(0);
        if(z == 6)
            B.setVisibility(0);
        else
            B.setVisibility(8);
    }

    public boolean onCreateOptionsMenu(Menu menu)
    {
        getMenuInflater().inflate(0x7f0c0002, menu);
        return super.onCreateOptionsMenu(menu);
    }

    public void onDestroy()
    {
        super.onDestroy();
        com.nnee.p_pr.cls_v.a().b(o);
    }

    public boolean onKeyDown(int i1, KeyEvent keyevent)
    {
        boolean flag = true;
        if(4 == i1 && ((flag && t==1)  ||(!flag && t!=1)))
            a(0);
        else
            flag = false;
        if(!flag)
            flag = super.onKeyDown(i1, keyevent);
        return flag;
    }

    protected void onNewIntent(Intent intent)
    {
        String s1;
        super.onNewIntent(intent);
        s1 = intent.getAction();
         
        if(s1 == null || !s1.equals("user"));
        return;
    }

    public boolean onOptionsItemSelected(MenuItem menuitem)
    {
        switch(menuitem.getItemId())
        {
        case 2131558723:
        	g();
        	break;
        	default:
        		break;
        }
        return super.onOptionsItemSelected(menuitem);
    }

    public static final int a = 0;
    public static final int b = 1;
    public static final int c = 0;
    public static final int d = 1;
    public static final String e = "user";
    public static final String f = "from";
    static final int g = 5;
    static final int h = 10;
    static final int i = 16;
    private static final String p = "state";
    private LinearLayout A;
    private TextView B;
    private ImageView C;
    private ImageView D;
    private TextView E;
    private TextView F;
    TextWatcher j;
    TextWatcher k;
    android.view.View.OnFocusChangeListener l;
    android.view.View.OnFocusChangeListener m;
    android.view.View.OnClickListener n;
    cls_b o;
    private boolean q;
    private int r;
    private int s;
    private int t;
    private int u;
    private Context v;
    private EditText w;
    private EditText x;
    private Button y;
    private int z;
}
